package learn.up.java.db.nosql.redis;

import org.junit.Test;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

public class JedisPOJOSerialization {

	@Test
	public void test1() {
		Jedis jedis = new Jedis("192.168.66.128",6379);
//		jedis.set("name", "John");
		System.out.println(jedis.get("name"));
		System.out.println(jedis.get("age"));
		jedis.close();
	}
	
	@Test
	public void test2() {
		JedisPoolConfig config = new JedisPoolConfig();
		config.setMaxIdle(5);
		config.setMaxTotal(6);
		JedisPool pool = new JedisPool(config,"192.168.66.128",6379);
		Jedis jedis = pool.getResource();
		jedis.set("age", "22");
		System.out.println(jedis.get("age"));
		pool.close();
	}
}
